import httpFetch from "share/httpFetch";
import config from "config";
import errorMessage from "share/errorMessage";

export default {
  //created by wangruonan 20181008
  //获取欢迎，系统消息
  getSystemWelcomeInfo (channelCode) {
    return new Promise((resolve, reject) => {
      httpFetch.get(`${config.baseUrl}/notification/api/notification/message`)
        .then((res) => {
          resolve(res);
        })
        .catch((err) => {
          errorMessage(err.response);
          reject(err);
        })
    })
  },


  //created by wangruonan 20181008
  //消息修改已读状态接口
  alreadyRead () {
    return new Promise((resolve, reject) => {
      httpFetch.put(config.baseUrl + `/notification/api/notification/message/read`)
        .then((res) => {
          resolve(res);
        })
        .catch((err) => {
          errorMessage(err.response);
          reject(err);
        })
    })
  },
}
